﻿using YNTK.System.Entitys.Dto.Permission.Organize;
using YNTK.System.Entitys.Permission;
using System.Collections.Generic;
using System.Threading.Tasks;
using YNTK.Common.Filter;

namespace YNTK.System.Interfaces.Permission
{
    /// <summary>
    /// 组织管理
    /// 版 本：V1.0.0.0.0
    /// 版 权：云南通科科技有限公司（https://www.yntkkj.com）
    /// 作 者：李仕鹏
    /// 日 期：2021.06.07 
    /// </summary>
    public interface IOrganizeService
    {
        /// <summary>
        /// 根据组织授权tk码获取组织信息
        /// </summary>
        /// <param name="code">授权tk码</param>
        /// <returns></returns>

       Task<TkResult<OrganizeInfoDto>> GetInfo(string code);

        /// <summary>
        /// 获取组织log路径和授权tk码
        /// </summary>
        /// <param name="id">组织id</param>
        /// <returns></returns>
        Task<(string,string)> GetLogPath(string id);

        /// <summary>
        /// 根据组织id集合获取组织数据
        /// </summary>
        /// <param name="ids">组织id集合</param>
        /// <returns></returns>
        Task<List<OrganizeEntity>> GetOrganizeListByIds(List<string> ids);

        /// <summary>
        /// 是否机构主管
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns></returns>
        Task<bool> GetIsManagerByUserId(string userId);

        /// <summary>
        /// 获取机构列表
        /// 提供给其他服务使用
        /// </summary>
        /// <returns></returns>
        Task<List<OrganizeEntity>> GetListAsync();

        /// <summary>
        /// 获取公司列表
        /// 提供给其他服务使用
        /// </summary>
        /// <returns></returns>
        Task<List<OrganizeEntity>> GetCompanyListAsync();

        /// <summary>
        /// 下属机构
        /// </summary>
        /// <param name="organizeId">机构ID</param>
        /// <param name="isAdmin">是否管理员</param>
        /// <returns></returns>
        Task<string[]> GetSubsidiary(string organizeId, bool isAdmin);

        /// <summary>
        /// 下属机构
        /// </summary>
        /// <param name="organizeId"></param>
        /// <returns></returns>
        Task<List<string>> GetSubsidiary(string organizeId);

        /// <summary>
        /// 根据节点Id获取所有子节点Id集合，包含自己
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<List<string>> GetChildIdListWithSelfById(string id);

        /// <summary>
        /// 获取机构成员列表
        /// </summary>
        /// <param name="organizeId">机构ID</param>
        /// <returns></returns>
        Task<List<OrganizeMemberListOutput>> GetOrganizeMemberList(string organizeId);

        /// <summary>
        /// 部门信息
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns></returns>
        Task<OrganizeEntity> GetInfoById(string Id);
    }
}
